package com.weeasy.home.controller;

import com.weeasy.core.common.Result;
import com.weeasy.home.service.HomeService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 微信首页控制器
 * 
 * @author we-easy
 * @since 1.0.0
 */
@RestController
@RequestMapping("/home")
@RequiredArgsConstructor
@CrossOrigin(origins = "*")
public class HomeController {

    private final HomeService homeService;

    /**
     * 获取首页信息
     * 
     * @return 首页信息
     */
    @GetMapping("/info")
    public Result<String> getHomeInfo() {
        String info = homeService.getHomeInfo();
        return Result.success("获取首页信息成功", info);
    }

    /**
     * 获取统计数据
     * 
     * @return 统计数据
     */
    @GetMapping("/stats")
    public Result<String> getStats() {
        String stats = homeService.getStats();
        return Result.success("获取统计数据成功", stats);
    }
}
